function [ nRow, nCol ] = getSize( this, type )
%GETSIZE Get `@DataMatrix` object size
% DataMatrix::getSize( this:DataMatrix, 
%                      type:{char, numeric} )
% 
%Description
% Get the number of rows and columns of `.mat`
%
%Input
% 1. dataMatrix
% 2. type
%
%Output
% 1. nRow : number of rows of `.mat`
% 2. nCol : number of cols of `.mat`
%
%Syntax
% ~. [nRow, nCol] = dataMatrix.getSize();
% ~. nRow/nCol = dataMatrix.getSize(type);
% ~. [nRow, nCol] = dataMatrix.getSize(type);
% 
%Example
% ~. [nRow, nCol] = dataMatrix.getSize();
% ~. nRow = dataMatrix.getSize('row');
% ~. nCol = dataMatrix.getSize('col');
% ~. [nRow, nCol] = dataMatrix('both');

if nargin == 1
    type = 'both';
end

switch lower(type)
    case {'row', 'r', 1}
        nRow = this.nRow;
    case {'column', 'col', 'c', 2}
        nCol = this.nCol;
        nRow = nCol; % For output
    case {'both', 'b', 3}
        nRow = this.nRow;
        nCol = this.nCol;
    otherwise
        error('BatErr: Invalid index type.');
end

end
